The function is a handler for the `notify::state` handler, so
the state and reason parameters used in the checks are always
undefined.
In addition, `DEACTIVATED` is not (just) a failure state. We
clearly don't want to complain about a failed connection when
the change happened on request of the user.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2406>
}
}
- _connectionStateChanged(ac, newstate, reason) {
- if (newstate === NM.ActiveConnectionState.DEACTIVATED &&
- reason !== NM.ActiveConnectionStateReason.NO_SECRETS)
+ _connectionStateChanged() {
+ const state = this._activeConnection?.get_state();
+ const reason = this._activeConnection?.get_state_reason();
+
+ if (state === NM.ActiveConnectionState.DEACTIVATED &&
+ reason !== NM.ActiveConnectionStateReason.NO_SECRETS &&
+ reason !== NM.ActiveConnectionStateReason.USER_DISCONNECTED)
this.emit('activation-failed');
this.emit('icon-changed');